<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<!DOCTYPE html>
<html>
<script>
    if (window.top !== window.self) {
        window.top.location = window.location
    }
</script>
<head>
    <meta charset="UTF-8">
    <title>斑马线交规驾考系统</title>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/css/main.css">
    <style>
        body {
            margin: 0;
            background: url("/image/bg.jpg") no-repeat fixed;
            background-size: cover;
        }
    </style>

</head>
<body>
<div class="container" style=""><br><br><br><br><br>
    <form action="${pageContext.request.contextPath}/user/login" id="myform" onsubmit='return LoginValid()' method="post">
        <div class="login-div"><br><br>
            <div class="login-title">用户登录</div>
            <br>
            <div class="login-input">
                <input type="text" placeholder="请输入手机号码" name="name" >
            </div>
            <div class="login-input">
                <input type="password" placeholder="请输入登录密码" name="pwd">
            </div>
            <input type="hidden" name="type" value="1">
            <span style="display:block;width:auto;text-align:center;color: red">${msg}</span>
            <span style="display:block;width:auto;text-align:center;color: red" id="sssss">${s}</span>
            <div class="login-btn">
                <a href="javascript:void(0)" onclick="Login()">
                    <img src="${pageContext.request.contextPath}/image/login.png" title="登录系统">
                </a>
                <br/> <br/>
                <a href="/p/user/zlogin" style="text-decoration: underline">藏文登陆入口<br/> བོད་ཡིག་ར་འཛེག་འཇུག་སྒོ། </a>
            </div>
            <div class="slogon2"><img src="${pageContext.request.contextPath}/image/slogon3.png"></div>
        </div>
    </form>
</div>
</body>
<script src="${pageContext.request.contextPath}/static/js/jquery.min.js"></script>
<script src="${pageContext.request.contextPath}/static/layer/layer.js"></script>
<%--<script src="${pageContext.request.contextPath}/static/js/plugins/layer/layer.min.js"></script>--%>
<%--<script src="${pageContext.request.contextPath}/static/js/importants.js"></script>--%>
<script type="text/javascript" language=JavaScript charset="UTF-8">

    function Login() {
        var $form = $("#myform");
        $form.submit();
//        $.get("/user/login",{name:$("input[name='name']").val(),pwd:$("input[name='pwd']").val(),type:1},function () {
//        },"json");
    }

    function LoginValid() {
        var Utel = $('input[name=name]').val();
        var Upass = $('input[name=pwd]').val();
        if (!Utel) {
            layer.msg('请输入电话号码', {icon: 2, time: 1000});
            $('input[name=Utel]').focus();
            return false;
        }
        if (!Upass) {
            layer.msg('请输入登录密码', {icon: 2, time: 1000});
            $('input[name=Upass]').focus();
            return false;
        }
    }

    document.onkeydown = function (event) {
        var e = event || window.event || arguments.callee.caller.arguments[0];
        if (e && e.keyCode == 13) { // enter 键
            Login();
        }
    };
</script>
</html>
